# -*- encoding: utf-8 -*-
##############################################################################
#
##############################################################################

from odoo import api, fields, models, _
from odoo.addons import decimal_precision as dp
from odoo.exceptions import UserError, ValidationError
from odoo.tools import float_round


class mrp_bom(models.Model):
    _inherit = 'mrp.bom'

class mrp_bom_line(models.Model):
    _inherit = 'mrp.bom.line'

    part_number = fields.Float(u'粒数',default=0.0)


class MrpProduction(models.Model):
    """ Manufacturing Orders """
    _inherit = 'mrp.production'

    mo_done_date = fields.Datetime(u'完工时间')
    part_number = fields.Float(u'要求完工粒数', default=0.0)
    part_weight = fields.Float(u'要求完工粒重', default=0.0)

    # def _generate_raw_move(self, bom_line, line_data):
    #     res = super(MrpProduction, self)._generate_raw_move(bom_line, line_data)
    #     res.part_number=line_data['part_number']
    #     return res